<template>
   <div class="box">
     <h1>组件a</h1>
     <div>显示数据：{{ msg }}</div>
     <button @click="send">传递</button>
   </div>


   <!-- 
     需求：点击发送按钮，将a组件的实例数据传递给其他组件 -->
</template>


<script>
export default {
    data(){
        return {
            msg:"我是a的数据"
        }
    },
    mounted(){
        console.log("A",this.EventBus);
    },
    methods:{
        send(){
            this.EventBus.$emit("sendAData",this.msg);
        }
    }
}
</script>

<style scoped>
h1{
    color:red
}
</style>